import { PrismaClient } from '@prisma/client';

/** @type {PrismaClient} */
export const db = globalThis.prisma || new PrismaClient();

// nextjs hot reload 将会创建多个primsa实例。
if (process.env.NODE_ENV === 'development') globalThis.prisma = db;
